Converts normal times like "1 day" or "1 month" to their respective seconds. Useful for setting cookies.

1 day:
makeSeconds(1,"day"); // 86400 Seconds
4 months:
makeSeconds(4,"months"); // Seconds
1 year (leap):
makeSeconds(2,"years",1);

NOTE: Months are calculated as 31 days, as the majority of months have 31 days.

========================================================

function makeSeconds($a,$m,$ly=false)	{ // Create the function. 3 Arguments: $a for amount, $m for measurement, $ly for leap year

	$minute = 60; // 60 Seconds to a minute

	$keys = array( // Multiplication factors for minutes.
				  "minute" => 1,
				  "minutes" => 1,
				  "hour" => 60,
				  "hours" => 60,
				  "day" => 60*24,
				  "days" => 60*24,
				  "week" => 60*24*7,
				  "weeks" => 60*24*7,
				  "month" => 60*24*7*31,
				  "months" => 60*24*7*31,
				  "year" => 60*24*7*365,
				  "years" => 60*24*7*365
				  );
	
	$seconds = $a * ($minute * $keys[$m]); // Seconds are equal to the amount specified times a minute times the unit of measurement specified.
	if($leapYear)	{ // If the user specified it as being a leap year.
		
		$seconds = $seconds + ($minute * $keys['day']); // Seconds are equal to the current value plus the value of a day
		
	}

	return $seconds;
	
} // Close the function.